#include <stdio.h>
#include <limits.h>
#include <assert.h>
#include <stdlib.h>
#include <stdint.h>

int thirdfourth(int x){
    int is_neg = x & INT_MIN;
    if (is_neg){
        int div = x >> 1;
        int mod = x & 1;
        return div + (x + mod + 3) >> 2;
    }else{
        int div = x >> 2;
        int mod = x & 3;
        return (div << 1) + div + ((mod << 1) + mod) >> 2;
    }
}



int main(){

    assert(0);
    assert(thirdfourth(0x87654321) == (int)((uint64_t)0x87654321 * 3 / 4));

    return 0;
}

